package com.yunduo.service.impl;

import com.yunduo.entity.User;
import com.yunduo.mapper.UserMapper;
import com.yunduo.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户服务类
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Resource
    private UserMapper userMapper;
    //分页可带条件查询teacher

    //根据用户名称查询
    @Override
    public User getUserByName(String name) {
        User user = userMapper.selectUserByName(name);
        return user;
    }

    //根据用户名称模糊匹配
    @Override
    public List<User> getUsersByName(String name,int count) {
        return userMapper.selectUsersByName(name,count);
    }
}
